package com.lvbaoins.creditapp.core.reqres;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel(value = "失败信息")
public class Error<T> implements Serializable {

    /**
     * 请求是否成功
     */
    @ApiModelProperty(value = "true",name = "是否成功状态", example = "false")
    private Boolean success;

    /**
     * 响应状态码
     */
    @ApiModelProperty(value = "10000",name = "成功状态码", example = "xxxxxx")
    private Integer code;

    /**
     * 响应信息
     */
    @ApiModelProperty(value = "失败",name = "消息", example = "系统内部错误")
    private String message;

    /**
     * 响应对象
     */
    @ApiModelProperty(value = "具体返回信息", name = "返回内容")
    private T data;

    public Error() {

    }

    public Error(Boolean success, Integer code, String message, T data) {
        this.success = success;
        this.code = code;
        this.message = message;
        this.data = data;
    }

}
